<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>{$person}</title>
    {include file="inset/head/head_css.tpl"}
    {include file="inset/head/head_js.tpl"}
</head>
<body>
    	
    <div class="b-popup none">
     <div class="b-popup-content">
	<div class="b-popup-header" align="right"><img id="close_popap" src="/static/img/toolbar/close-tab.png" width="20px"/></div>
	<form>
	    <div class="new_order">
		<div><label>Код клиента:</label></div>	
		<div style=" text-align:left;margin-left:24px;"><input type="text" class="validate[required,custom[integer]]" id="id_client" name="id_client" style="width:30%;"/></div>		
	    </div>
	    <div class="new_order">
		<div><label>Категория:</label></div>	
		<div>
		    <select class="validate[required]" width="90%" id="id_category">
			{for $i=0 to $params|@count-1}
			    <option value="{$params.$i.id}">{$params.$i.name}</option>
			{/for}
		    </select>
		</div>		
	    </div>
	    <div class="new_order">
		<div><label>Производитель:</label></div>	
		<div>
		    <select class="validate[required]" id="id_fabricator">
			{for $i=0 to $fabricator|@count-1}
			    <option value="{$fabricator.$i.id}">{$fabricator.$i.name}</option>
			{/for}
		    </select>
		</div>		
	    </div>
	    <div class="new_order">
		<div><label>Продукт:</label></div>	
		<div>
		    <select  class="validate[required]" id="product">
			<option>Выберете продукт</option>
    
		    </select>
		</div>		
	    </div>
            <div class="new_order">
		<div><label>Детали по товару:</label></div>	
		<div><input type="text"  value="00.00" id="discont" name="discont"/></div>
	    </div>
	    <div class="new_order">
		<div><label>Количество</label></div>	
		<div><input class="validate[required,custom[integer]]" type="text" id="count" name="count"/></div>		
	    </div>
	     <div class="new_order">
		<div><label>Дата отправки:</label></div>	
		<div><input type="text" class="" value="" readonly id="date_ship" name="date_ship"/></div>
	    </div>
	    <div class="new_order">
		<div><label>Скидка:</label></div>	
		<div><input type="text" class="validate[required,custom[number]]" value="00.00" id="discont" name="discont"/></div>
	    </div>
	    <div class="new_order">
		<div><label>Сайт:</label></div>	
		<div>
		    <select id="id_site">
			<option value="1">mebelend.com.ua</option>
			<option value="2">mebelex.dp.ua</option>
			<option value="3">matras-sale.com.ua</option>
			<option value="4">artemdorofeyev</option>
		    </select>
		</div>		
	    </div>
	    <div class="client_submit">
            <input id="order_add"  type="button" value="Добавить ещё"/>
	    <input id="order_submit"  type="button" value="Сохранить"/>
	    </div>
	</form>
     </div>
    </div>	
    <div class="wrapper">
       {include file="inset/header.tpl"}
        
        {include file="inset/menu/vermenu.tpl"}
	
        <div class="content">
	    <div class="navigation">
		<div class="order_navigation">
		<form action="/orders/find/" method="get" id="client_form">
		    <ul>
		    <li>
			<div id="order_button" class="button">
			    Создать заказ	
			</div>
		    </li>
		    <li>
			<select name="status">
			    <option value="">Все</option>
			    <option value="Новый">Новый</option>
			    <option value="В заказ">В заказ</option>
			</select>
		    </li>
		    <li>
			<label>Фамилия</label>
			<input name="name" type="text" />
		    </li>
		    <li>
			<label>Телефон</label>
			<input name="phone" type="text" />
		    </li>
		    
		    <li><input type="submit" value="найти"/></li>
		   </ul>
		</form>
		</div><!--client_navigation-->
	    </div><!--navigation-->
	    <table class="client_table" cellspacing="0" cellpadding="0">
	        <tr>
	            <th width="8%">
		        Код заказа
                    </th>
		    <th width="17%">
		        ФИО
		    </th>
		    <th width="15%">
		        Телефон
		    </th>
		    <th width="10%">
		        Дата заказа
		    </th>
		    <th width="20%">
		        Статус
		    </th>
		    <th width="5%">
		        Удалить
		    </th>
		    <th width="20%">
		        Создатель
		    </th>
	        </tr>
                {if isset($orders)}
                {for $i=0 to $orders|@count-1}
		<tr>
		    <td>
                        <p><a href="/someorder/index/{$orders.$i.id}">{$orders.$i.id}</a></p>
		    </td>
		    <td>
			<p><a href="/someclient/index/{$orders.$i.id_client}">{$orders.$i.client}</a></p>
		    </td>
		    <td>
			<p>{$orders.$i.phone}</p>
		    </td>
		    <td>
			<p>{$orders.$i.date_create} </p>
		    </td>
		    <td>
			<p>{$orders.$i.status}</p>
		    </td>
		    <td>
			<p><a onclick='if (confirm("Удалить?")) {  window.location ="/orders/delete/{$orders.$i.id}";}' href="#">X</a></p>
		    </td>
		    <td>
			<p>{$orders.$i.id_person}</p>
		    </td>
		</tr>
		{/for}
                <tr>
                    <td colspan="7" class="pages"><div> <p>{$pages}</p></div></td>
                </tr>
                {/if}
                {if isset($error)}
                <tr>
                    <td colspan="7">{$error.error}</td>
                </tr>
                {/if}
	    </table>
           
	</div>
    </div>
    {include file="inset/footer.tpl"}
</body>
</html>
